package com.example.dishit.service.recommendation;

import java.io.Serializable;
import java.util.List;

/**
 * The recommended restaurant.
 * 
 * @author esubar
 * 
 */
public class RestaurantRecommendation implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private String restaurantName;
    private Float priceMin;
    private Float priceMax;
    private List<String> imageUrls;
    private List<String> keywords;
    private List<String> reasons;
    private Float rating;
    private List<String> comments;
    private String mapUrl;
    private String streetAddress;
    private String city;
    private String state;
    private String zipcode;
    private Long phoneNumberDigits;
    private String websiteUrl;
    
    public static class Builder {
        private String restaurantName;
        private Float priceMin;
        private Float priceMax;
        private List<String> imageUrls;
        private List<String> keywords;
        private List<String> reasons;
        private Float rating;
        private List<String> comments;
        private String mapUrl;
        private String streetAddress;
        private String city;
        private String state;
        private String zipcode;
        private Long phoneNumberDigits;
        private String websiteUrl;
        
        public Builder restaurantName(String restaurantName) {
            this.restaurantName = restaurantName;
            return this;
        }
        
        public Builder priceMin(Float priceMin) {
            this.priceMin = priceMin;
            return this;
        }
        
        public Builder priceMax(Float priceMax) {
            this.priceMax = priceMax;
            return this;
        }
        
        public Builder imageUrls(List<String> imageUrls) {
            this.imageUrls = imageUrls;
            return this;
        }
        
        public Builder keywords(List<String> keywords) {
            this.keywords = keywords;
            return this;
        }
        
        public Builder reasons(List<String> reasons) {
            this.reasons = reasons;
            return this;
        }
        
        public Builder rating(Float rating) {
            this.rating = rating;
            return this;
        }
        
        public Builder comments(List<String> comments) {
            this.comments = comments;
            return this;
        }
        
        public Builder mapUrl(String mapUrl) {
            this.mapUrl = mapUrl;
            return this;
        }
        
        public Builder streetAddress(String streetAddress) {
            this.streetAddress = streetAddress;
            return this;
        }
        
        public Builder city(String city) {
            this.city = city;
            return this;
        }
        
        public Builder state(String state) {
            this.state = state;
            return this;
        }
        
        public Builder zipcode(String zipcode) {
            this.zipcode = zipcode;
            return this;
        }
        
        public Builder phoneNumberDigits(Long phoneNumberDigits) {
            this.phoneNumberDigits = phoneNumberDigits;
            return this;
        }
        
        public Builder websiteUrl(String websiteUrl) {
            this.websiteUrl = websiteUrl;
            return this;
        }
        
        public RestaurantRecommendation build() {
            return new RestaurantRecommendation(this);
        }
    }
    
    private RestaurantRecommendation(Builder builder) {
        this.restaurantName = builder.restaurantName;
        this.priceMin = builder.priceMin;
        this.priceMax = builder.priceMax;
        this.imageUrls = builder.imageUrls;
        this.keywords = builder.keywords;
        this.reasons = builder.reasons;
        this.rating = builder.rating;
        this.comments = builder.comments;
        this.mapUrl = builder.mapUrl;
        this.streetAddress = builder.streetAddress;
        this.city = builder.city;
        this.state = builder.state;
        this.zipcode = builder.zipcode;
        this.phoneNumberDigits = builder.phoneNumberDigits;
        this.websiteUrl = builder.websiteUrl;
    }
    
    public String getRestaurantName() {
        return restaurantName;
    }
    
    public Float getPriceMin() {
        return priceMin;
    }
    
    public Float getPriceMax() {
        return priceMax;
    }
    
    public List<String> getImageUrls() {
        return imageUrls;
    }
    
    public List<String> getKeywords() {
        return keywords;
    }
    
    public List<String> getReasons() {
        return reasons;
    }
    
    public Float getRating() {
        return rating;
    }
    
    public List<String> getComments() {
        return comments;
    }
    
    public String getMapUrl() {
        return mapUrl;
    }
    
    public String getStreetAddress() {
        return streetAddress;
    }
    
    public String getCity() {
        return city;
    }
    
    public String getState() {
        return state;
    }
    
    public String getZipcode() {
        return zipcode;
    }
    
    public Long getPhoneNumberDigits() {
        return phoneNumberDigits;
    }
    
    public String getWebsiteUrl() {
        return websiteUrl;
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((city == null) ? 0 : city.hashCode());
        result = prime * result
                + ((comments == null) ? 0 : comments.hashCode());
        result = prime * result
                + ((imageUrls == null) ? 0 : imageUrls.hashCode());
        result = prime * result
                + ((keywords == null) ? 0 : keywords.hashCode());
        result = prime * result + ((mapUrl == null) ? 0 : mapUrl.hashCode());
        result = prime
                * result
                + ((phoneNumberDigits == null) ? 0 : phoneNumberDigits
                        .hashCode());
        result = prime * result
                + ((priceMax == null) ? 0 : priceMax.hashCode());
        result = prime * result
                + ((priceMin == null) ? 0 : priceMin.hashCode());
        result = prime * result + ((rating == null) ? 0 : rating.hashCode());
        result = prime * result + ((reasons == null) ? 0 : reasons.hashCode());
        result = prime * result
                + ((restaurantName == null) ? 0 : restaurantName.hashCode());
        result = prime * result + ((state == null) ? 0 : state.hashCode());
        result = prime * result
                + ((streetAddress == null) ? 0 : streetAddress.hashCode());
        result = prime * result
                + ((websiteUrl == null) ? 0 : websiteUrl.hashCode());
        result = prime * result + ((zipcode == null) ? 0 : zipcode.hashCode());
        return result;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        RestaurantRecommendation other = (RestaurantRecommendation) obj;
        if (city == null) {
            if (other.city != null)
                return false;
        } else if (!city.equals(other.city))
            return false;
        if (comments == null) {
            if (other.comments != null)
                return false;
        } else if (!comments.equals(other.comments))
            return false;
        if (imageUrls == null) {
            if (other.imageUrls != null)
                return false;
        } else if (!imageUrls.equals(other.imageUrls))
            return false;
        if (keywords == null) {
            if (other.keywords != null)
                return false;
        } else if (!keywords.equals(other.keywords))
            return false;
        if (mapUrl == null) {
            if (other.mapUrl != null)
                return false;
        } else if (!mapUrl.equals(other.mapUrl))
            return false;
        if (phoneNumberDigits == null) {
            if (other.phoneNumberDigits != null)
                return false;
        } else if (!phoneNumberDigits.equals(other.phoneNumberDigits))
            return false;
        if (priceMax == null) {
            if (other.priceMax != null)
                return false;
        } else if (!priceMax.equals(other.priceMax))
            return false;
        if (priceMin == null) {
            if (other.priceMin != null)
                return false;
        } else if (!priceMin.equals(other.priceMin))
            return false;
        if (rating == null) {
            if (other.rating != null)
                return false;
        } else if (!rating.equals(other.rating))
            return false;
        if (reasons == null) {
            if (other.reasons != null)
                return false;
        } else if (!reasons.equals(other.reasons))
            return false;
        if (restaurantName == null) {
            if (other.restaurantName != null)
                return false;
        } else if (!restaurantName.equals(other.restaurantName))
            return false;
        if (state == null) {
            if (other.state != null)
                return false;
        } else if (!state.equals(other.state))
            return false;
        if (streetAddress == null) {
            if (other.streetAddress != null)
                return false;
        } else if (!streetAddress.equals(other.streetAddress))
            return false;
        if (websiteUrl == null) {
            if (other.websiteUrl != null)
                return false;
        } else if (!websiteUrl.equals(other.websiteUrl))
            return false;
        if (zipcode == null) {
            if (other.zipcode != null)
                return false;
        } else if (!zipcode.equals(other.zipcode))
            return false;
        return true;
    }
    
    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("RestaurantRecommendation [");
        if (restaurantName != null)
            builder.append("restaurantName=").append(restaurantName)
                    .append(", ");
        if (priceMin != null)
            builder.append("priceMin=").append(priceMin).append(", ");
        if (priceMax != null)
            builder.append("priceMax=").append(priceMax).append(", ");
        if (imageUrls != null)
            builder.append("imageUrls=").append(imageUrls).append(", ");
        if (keywords != null)
            builder.append("keywords=").append(keywords).append(", ");
        if (reasons != null)
            builder.append("reasons=").append(reasons).append(", ");
        if (rating != null)
            builder.append("rating=").append(rating).append(", ");
        if (comments != null)
            builder.append("comments=").append(comments).append(", ");
        if (mapUrl != null)
            builder.append("mapUrl=").append(mapUrl).append(", ");
        if (streetAddress != null)
            builder.append("streetAddress=").append(streetAddress).append(", ");
        if (city != null)
            builder.append("city=").append(city).append(", ");
        if (state != null)
            builder.append("state=").append(state).append(", ");
        if (zipcode != null)
            builder.append("zipcode=").append(zipcode).append(", ");
        if (phoneNumberDigits != null)
            builder.append("phoneNumberDigits=").append(phoneNumberDigits)
                    .append(", ");
        if (websiteUrl != null)
            builder.append("websiteUrl=").append(websiteUrl);
        builder.append("]");
        return builder.toString();
    }
}
